<?php /* Smarty version 2.6.6, created on 2013-10-24 14:17:48
         compiled from playlistList.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'count', 'playlistList.tpl', 31, false),array('modifier', 'stripslashes', 'playlistList.tpl', 71, false),array('modifier', 'truncate', 'playlistList.tpl', 75, false),)), $this); ?>
<?php echo '
    <script type="text/javascript">
    function checkForm()
    {
        var PlaylistChecked = jQuery(\'input[name="playlist[]"]:checked\').length;
            if(PlaylistChecked<=0){
                hideAllErrors();
                jQuery("#playlistError").css("display","block");    
                jQuery("#playlistError").focus();   
                return false;
            }else{
                hideAllErrors();
            }
        return true;
    
    }

    function hideAllErrors() 
    {
        jQuery("#playlistError").css("display","none");    
    }
    </script>
'; ?>

<div id="main_wrap">
    <div class="center_wrap clearfix">
        <h2 class="no_bottom no_top breadcrumb">
            <a>Playlists</a>
        </h2>
        <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "accountmenu.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?> 
        <div class="right col1" style="margin:0px;">
            <?php if (count($this->_tpl_vars['listplaylists']) > '0' && $this->_tpl_vars['userID'] != ''): ?>
                <form method="POST" action="<?php echo $this->_tpl_vars['formAction']; ?>
" id="playlistForm" name="playlistForm">
                <?php endif; ?>  
                <div class="cat_box_full clearfix" id="browse_main"> 
                                        <table width="100%" cellspacing="3" cellpadding="3" border="0">
                        <tr>
                            <td valign="top">
                                <h2>View playlists</h2>
                                <div class="uerror" id="playlistError">Error: Please select atleast one playlist to share.</div>
                            </td>
                        </tr>
                        <?php if ($this->_tpl_vars['userID'] != ""): ?>
                            <tr>
                                <td valign="top">
                                    <a href="<?php echo $this->_tpl_vars['baseurl']; ?>
/myplaylist.php">View my playlist</a> &nbsp;
                                    <a href="<?php echo $this->_tpl_vars['baseurl']; ?>
/mysharedplaylist.php">View my shared playlist</a>
                                </td>
                            </tr>
                        <?php endif; ?>
                    </table>	
                    <div class="cat_body_full clearfix">
                        <?php if ($this->_tpl_vars['error'] != ""): ?>
                            <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "show_error.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
                        <?php endif; ?>
                        <?php if ($this->_tpl_vars['message'] != ""): ?>
                            <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "show_message.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
                        <?php endif; ?>

                        <!-- LOOP START -->
                        <div id="browse_results">
                            <?php if (count($this->_tpl_vars['listplaylists']) > 0): ?>
                                <ul>
                                    <?php unset($this->_sections['i']);
$this->_sections['i']['name'] = 'i';
$this->_sections['i']['loop'] = is_array($_loop=$this->_tpl_vars['listplaylists']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['i']['show'] = true;
$this->_sections['i']['max'] = $this->_sections['i']['loop'];
$this->_sections['i']['step'] = 1;
$this->_sections['i']['start'] = $this->_sections['i']['step'] > 0 ? 0 : $this->_sections['i']['loop']-1;
if ($this->_sections['i']['show']) {
    $this->_sections['i']['total'] = $this->_sections['i']['loop'];
    if ($this->_sections['i']['total'] == 0)
        $this->_sections['i']['show'] = false;
} else
    $this->_sections['i']['total'] = 0;
if ($this->_sections['i']['show']):

            for ($this->_sections['i']['index'] = $this->_sections['i']['start'], $this->_sections['i']['iteration'] = 1;
                 $this->_sections['i']['iteration'] <= $this->_sections['i']['total'];
                 $this->_sections['i']['index'] += $this->_sections['i']['step'], $this->_sections['i']['iteration']++):
$this->_sections['i']['rownum'] = $this->_sections['i']['iteration'];
$this->_sections['i']['index_prev'] = $this->_sections['i']['index'] - $this->_sections['i']['step'];
$this->_sections['i']['index_next'] = $this->_sections['i']['index'] + $this->_sections['i']['step'];
$this->_sections['i']['first']      = ($this->_sections['i']['iteration'] == 1);
$this->_sections['i']['last']       = ($this->_sections['i']['iteration'] == $this->_sections['i']['total']);
?>
                                        <li class="video">
                                            <div class="video_i">
                                                <a href="<?php echo $this->_tpl_vars['baseurl']; ?>
/view_playlist.php?ID=<?php echo $this->_tpl_vars['listplaylists'][$this->_sections['i']['index']]['PLAYLISTID']; ?>
">
                                                    <img class="imag" height="87" width="116" alt="<?php echo ((is_array($_tmp=$this->_tpl_vars['listaudios'][$this->_sections['i']['index']]['playlist_title'])) ? $this->_run_mod_handler('stripslashes', true, $_tmp) : stripslashes($_tmp)); ?>
" src="<?php echo $this->_tpl_vars['baseurl']; ?>
/images/tjj_music_dj_headset.png" />
                                                    <div class="tag"></div>
                                                </a>
                                                <a href="<?php echo $this->_tpl_vars['baseurl']; ?>
/view_playlist?ID=<?php echo $this->_tpl_vars['listplaylists'][$this->_sections['i']['index']]['PLAYLISTID']; ?>
">
                                                    <span class="artist_name"><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['listplaylists'][$this->_sections['i']['index']]['playlist_title'])) ? $this->_run_mod_handler('stripslashes', true, $_tmp) : stripslashes($_tmp)))) ? $this->_run_mod_handler('truncate', true, $_tmp, 15, "...", true) : smarty_modifier_truncate($_tmp, 15, "...", true)); ?>
</span>
                                                </a>
                                                <?php if ($this->_tpl_vars['userID'] != ""): ?>
                                                Share <input type="checkbox" name="playlist[]" id="<?php echo $this->_tpl_vars['listplaylists'][$this->_sections['i']['index']]['PLAYLISTID']; ?>
" value="<?php echo $this->_tpl_vars['listplaylists'][$this->_sections['i']['index']]['PLAYLISTID']; ?>
" />&nbsp;
                                                <?php endif; ?>
                                            </div>
                                            </il>
                                        <?php endfor; endif; ?>	
                                </ul>

                                <div class="clear"></div>
                            <?php endif; ?>
                        </div>
                        <!-- LOOP END -->

                    </div>

                    <div class="paginate">
                        <?php echo $this->_tpl_vars['pagelinks']; ?>

                                            </div>
                </div>
                <?php if (count($this->_tpl_vars['listplaylists']) > '0' && $this->_tpl_vars['userID'] != ''): ?>
                    <br />
                    <div class="cat_box_full clearfix" id="browse_main"> 
                        <h2 style="padding-bottom:10px;">Add to my share list</h2>
                            <button id="addtoplaylist" name="addtoplaylist" type="submit" onCLick="return checkForm();">Share</button>
                    </div>
                </form>
            <?php endif; ?>      
        </div>
        <div class="clear"></div>
    </div>
</div>